package com.ozo.boot.system.controller;

import com.ozo.boot.common.base.model.ResultVO;
import com.ozo.boot.system.service.ISysFileService;
import com.ozo.boot.system.pojo.vo.SysFileVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * <p>
 * 文件 前端控制器
 * </p>
 *
 * @author qiangesoft
 * @since 2024-07-11
 */
@Tag(name = "文件管理")
@RequiredArgsConstructor
@RestController
@RequestMapping("/system/file")
public class SysFileController {

    private final ISysFileService sysFileService;

    @Operation(summary = "上传文件")
    @PostMapping("/upload")
    public ResultVO<SysFileVO> upload(@RequestParam("file") MultipartFile file) {
        return ResultVO.success(sysFileService.upload(file));
    }

}
